package com.kuang.dao.user;

import com.kuang.pojo.Role;
import com.kuang.pojo.User;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface UserDao {

    //得到要登录的用户
    User getLoginUser(Connection connection,String userCode);

    //修改当前用户密码
    int updatePwd(Connection connection,int id,String password);

    //查询用户总数
    int getUserCount(Connection connection,String userName, int userRole) throws Exception;

    //获取用户列表
    List<User> getUserList(Connection connection, String userName, int userRole, int currentPageNo, int pageSize) throws Exception;

    //添加用户
    int add(Connection connection, User user) throws Exception;

    //删除用户
    int delete(Connection connection,int id);

    //修改信息
    int userModify(Connection connection, User user) throws Exception;

    //根据id查询用户
    User selectById(Connection connection,int id);
}
